package com.ibeeking.found.common.entity.mq;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName MqOrderParam
 * @Description
 * @Author ibeeking
 * @Date 2021-03-04 11:19
 **/
@Data
public class MqOrderCostDTO implements Serializable {
private static final long serialVersionUID = 1L;

	@NotNull(message = "会员id")
	private Long memberId;

	@NotBlank(message = "订单时间")
	private String orderTime;

	@NotNull(message = "订单流水号")
	private String tradeNo;

	@NotNull(message = "支付方式")
	private List<Integer> payType;

	@NotEmpty(message = "订单详情")
	private List<CostDetail> costDetailList;


	@Data
	public static class CostDetail{
		@NotNull(message = "订单编号")
		private String orderNo;
		/**
		 * 订单渠道，1-线上商城，2-积分商城，3-线下商户
		 */
		private Integer orderChannel;

		//订单下实物商品 或 优惠券商品 的金额总额
		@NotNull(message = "实付金额")
		private Long amount;

		@NotNull(message = "sku类型")
		private Integer goodsModule;

		@NotNull(message = "店铺id")
		private Long shopId;

		@NotBlank(message = "支付时间不能为空")
		private String payTime;

		@NotNull(message = "商品id")
		private List<Long> goodsIds;
		/**
		 * 支付明细
		 */
		private List<PayType> payTypes;
	}

	@Data
	public static class PayType{
		/**
		 * 支付方式id
		 */
		private String id;
		/**
		 * 支付方式name
		 */
		private String name;
		/**
		 * 金额
		 */
		private Long amount;
		/**
		 * 支付方式是否送积分
		 */
		private Boolean integralFlag;
	}

}
